package com.dayuanit.dy11.mall.mallspringboot.controller;

import com.dayuanit.dy11.mall.mallspringboot.dto.ResponseDTO;
import com.dayuanit.dy11.mall.mallspringboot.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HomeController {

    @Autowired
    private HomeService homeService;

    @RequestMapping(value = "/getCatalog", method = RequestMethod.GET)
    public ResponseDTO getCatalog() {
        return ResponseDTO.success(homeService.listCatalog());
    }

    @RequestMapping(value = "/getHomeCommoditys", method = RequestMethod.GET)
    public ResponseDTO getHomeCommoditys() {
        return ResponseDTO.success(homeService.listHomeCommoditys());
    }

}
